/*
 * Copyright 2020 edenrun.cn All right reserved. This software is the
 * confidential and proprietary information ofedenrun.cn ("Confidential
 * Information"). You shall not disclose such Confidential Information and shall
 * use it only in accordance with the terms of the license agreement you entered
 * into with edenrun.cn.
 */

package com.zoom.pluto.smf.controller;

import com.zoom.pluto.common.model.dto.SmfDTO;
import com.zoom.pluto.smf.model.dto.Result;
import com.zoom.pluto.smf.service.impl.SmfClientServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * SMF 服务接口调用控制层
 *
 * @author zoom
 * @date 2020-06-02
 */
@CrossOrigin(origins = "*", allowedHeaders = "*", maxAge = 3600)
@RestController
@Api(value = "SMF服务接口", tags = {"SMF服务接口"})
public class SmfController {

    @Resource
    SmfClientServiceImpl smfClientService;

    //    @ApiOperation(value = "根据流水号（医院挂号）取得单次病人就诊信息", httpMethod = "GET")
    //    @GetMapping(value = "/smf/query/patno/{patno}")
    //    public Result querySmfDetailByPatNo(@PathVariable String patno) {
    //        return Result.success(smfClientService.querySmfDetailByPatNo(patno));
    //    }

    //    @ApiOperation(value = "根据病历号取得病人多次的就诊信息", httpMethod = "GET")
    //    @GetMapping(value = "/smf/query/binglino/{binglino}")
    //    public Result querySmfDetailListByBinglino(@PathVariable String binglino) {
    //        return Result.success(smfClientService.querySmfDetailListByBinglino(binglino));
    //    }

    @ApiOperation(value = "根据身份证取得单次病人就诊信息,测试账号：310110196406016220", httpMethod = "GET")
    @GetMapping(value = "/smf/query/idno/{idno}")
    public Result<SmfDTO> querySmfDetailByIdNo(@PathVariable String idno) {
        return Result.success(smfClientService.querySmfDetailByPatNo(idno));
    }

}
